package com.ljx.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 管理员信息表
 * @TableName e_emp_info
 */
@TableName(value ="e_emp_info")
@Data
@ApiModel("管理员信息表")
public class EmpInfo implements Serializable {
    /**
     * 管理员id
     */
    @TableId
    @ApiModelProperty(name = "id",value = "管理员id", dataType = "String")
    private String id;

    /**
     * 管理员名字
     */
    @ApiModelProperty(name = "ename",value = "管理员名字", dataType = "String")
    private String ename;

    /**
     * 入职时间
     */
    @ApiModelProperty(name = "gmtCreate",value = "入职时间", dataType = "Date")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @ApiModelProperty(name = "gmtModified",value = "更新时间", dataType = "Date")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date gmtModified;

    /**
     * 电话
     */
    @ApiModelProperty(name = "telephone",value = "电话", dataType = "String")
    private String telephone;

    /**
     * 角色
     */
    @ApiModelProperty(name = "rid",value = "角色", dataType = "String")
    private String rid;

    /**
     * 年龄
     */
    @ApiModelProperty(name = "age",value = "年龄", dataType = "int")
    private Integer age;

    /**
     * 员工状态 0在职 1离职 2冻结
     */
    @ApiModelProperty(name = "state",value = "员工状态 0在职 1离职 2冻结", dataType = "int")
    private Integer state;

    /**
     * 管理员密码
     */
    @ApiModelProperty(name = "password",value = "管理员密码", dataType = "String")
    private String password;

    /**
     * 加盐
     */
    @ApiModelProperty(name = "salt",value = "加盐", dataType = "String")
    private String salt;

    /**
     * 管理的地区id
     */
    @ApiModelProperty(name = "areaId",value = "管理的地区id", dataType = "String")
    private String areaId;

    /**
     * 操作人
     */
    @ApiModelProperty(name = "updatemanid",value = "操作人", dataType = "String")
    private String updatemanid;

    /**
     * 逻辑删除 1（true）已删除， 0（false）未删除
     */
    @TableLogic
    @ApiModelProperty(name = "isDeleted",value = "逻辑删除 1（true）已删除， 0（false）未删除", dataType = "int")
    private Integer isDeleted;

    @ApiModelProperty(name = "role",value = "管理员角色", dataType = "Role")
    @TableField(exist = false)
    private Role role;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EmpInfo other = (EmpInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getEname() == null ? other.getEname() == null : this.getEname().equals(other.getEname()))
            && (this.getGmtCreate() == null ? other.getGmtCreate() == null : this.getGmtCreate().equals(other.getGmtCreate()))
            && (this.getGmtModified() == null ? other.getGmtModified() == null : this.getGmtModified().equals(other.getGmtModified()))
            && (this.getTelephone() == null ? other.getTelephone() == null : this.getTelephone().equals(other.getTelephone()))
            && (this.getRid() == null ? other.getRid() == null : this.getRid().equals(other.getRid()))
            && (this.getAge() == null ? other.getAge() == null : this.getAge().equals(other.getAge()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
            && (this.getSalt() == null ? other.getSalt() == null : this.getSalt().equals(other.getSalt()))
            && (this.getAreaId() == null ? other.getAreaId() == null : this.getAreaId().equals(other.getAreaId()))
            && (this.getUpdatemanid() == null ? other.getUpdatemanid() == null : this.getUpdatemanid().equals(other.getUpdatemanid()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getEname() == null) ? 0 : getEname().hashCode());
        result = prime * result + ((getGmtCreate() == null) ? 0 : getGmtCreate().hashCode());
        result = prime * result + ((getGmtModified() == null) ? 0 : getGmtModified().hashCode());
        result = prime * result + ((getTelephone() == null) ? 0 : getTelephone().hashCode());
        result = prime * result + ((getRid() == null) ? 0 : getRid().hashCode());
        result = prime * result + ((getAge() == null) ? 0 : getAge().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
        result = prime * result + ((getSalt() == null) ? 0 : getSalt().hashCode());
        result = prime * result + ((getAreaId() == null) ? 0 : getAreaId().hashCode());
        result = prime * result + ((getUpdatemanid() == null) ? 0 : getUpdatemanid().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", ename=").append(ename);
        sb.append(", gmtCreate=").append(gmtCreate);
        sb.append(", gmtModified=").append(gmtModified);
        sb.append(", telephone=").append(telephone);
        sb.append(", rid=").append(rid);
        sb.append(", age=").append(age);
        sb.append(", state=").append(state);
        sb.append(", password=").append(password);
        sb.append(", salt=").append(salt);
        sb.append(", areaId=").append(areaId);
        sb.append(", updatemanid=").append(updatemanid);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}